home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / etc / init.d / mountdevsubfs.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  2006-10-06  |  1.5 KB  |  68 lines

  1. #! /bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides:          mountdevsubfs mountvirtfs
  4. # Required-Start:    mountkernfs
  5. # Required-Stop:
  6. # Default-Start:     S
  7. # Default-Stop:
  8. # Short-Description: Mount special file systems under /dev.
  9. # Description:       Mount the virtual filesystems the kernel provides
  10. #                    that ordinarily live under the /dev filesystem.
  11. ### END INIT INFO
  12.  
  13. PATH=/lib/init:/sbin:/bin
  14. TTYGRP=5
  15. TTYMODE=620
  16. [ -f /etc/default/devpts ] && . /etc/default/devpts
  17.  
  18. TMPFS_SIZE=
  19. [ -f /etc/default/tmpfs ] && . /etc/default/tmpfs
  20.  
  21. KERNEL="$(uname -s)"
  22.  
  23. . /lib/lsb/init-functions
  24. . /lib/init/mount-functions.sh
  25.  
  26. do_start () {
  27.     #
  28.     # Mount a tmpfs on /dev/shm
  29.     #
  30.     SHM_OPT=
  31.     [ "${SHM_SIZE:=$TMPFS_SIZE}" ] && SHM_OPT="-osize=$SHM_SIZE"
  32.     domount tmpfs shmfs /dev/shm $SHM_OPT
  33.  
  34.     #
  35.     # Mount /dev/pts. Create master ptmx node if needed.
  36.     #
  37.     domount devpts "" /dev/pts -ogid=$TTYGRP,mode=$TTYMODE
  38.  
  39.     #
  40.     # Magic to make /proc/bus/usb work
  41.     #
  42.     [ -d /dev/bus/usb/.usbfs ] || mkdir -p /dev/bus/usb/.usbfs
  43.     domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
  44.     ln -s .usbfs/devices /dev/bus/usb/devices
  45.     mount --rbind /dev/bus/usb /proc/bus/usb
  46. }
  47.  
  48. case "$1" in
  49.   "")
  50.     echo "Warning: mountdevsubfs should be called with the 'start' argument." >&2
  51.     do_start
  52.     ;;
  53.   start)
  54.     do_start
  55.     ;;
  56.   restart|reload|force-reload)
  57.     echo "Error: argument '$1' not supported" >&2
  58.     exit 3
  59.     ;;
  60.   stop)
  61.     # No-op
  62.     ;;
  63.   *)
  64.     echo "Usage: mountdevsubfs [start|stop]" >&2
  65.     exit 3
  66.     ;;
  67. esac
  68.